package com.richpay.basejava.base10;

/**
 * 实现Cloneable接口表示可以被克隆
 */
public class Dog implements Cloneable {
    private String name;

    public Dog(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "昵称:"+this.name;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();//具体的克隆操作由父类完成
    }
}
